package com.karst.essentials.chapter06
{
	import flash.events.Event;
	
	import org.papervision3d.materials.ColorMaterial;
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.objects.primitives.Plane;
	import org.papervision3d.view.BasicView;

	internal class OrbitExample2 extends InteractionTemplate
	{
		private var easeOut : Number = .3 ;
		private var rotX : Number = .3 ;
		private var rotY : Number = .3 ;
		private var camPicth : Number = 90 ;
		private var camYaw : Number = 270 ;
		
		public function OrbitExample2()
		{
			super() ;
		}

		override protected function onRenderTick(event:Event=null):void
		{
			super.onRenderTick( event ) ;
			camPicth += (( mouseY - height * .5 ) * rotX + 90 - camPicth ) * easeOut ;
			camYaw += (( mouseX - width * .5  ) * rotY + 270 - camYaw ) * easeOut ;
			camera.orbit( camPicth, camYaw ) ;
		}
	}
	
}